home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / OutOfPhase1.01Source / OutOfPhase Folder / LFOGenerator.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  2.5 KB  |  76 lines  |  [TEXT/KAHL]

  1. /* LFOGenerator.h */
  2.  
  3. #ifndef Included_LFOGenerator_h
  4. #define Included_LFOGenerator_h
  5.  
  6. /* LFOGenerator module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Memory */
  12. /* EnvelopeState */
  13. /* FastFixedPoint */
  14. /* LFOSpecifier */
  15. /* LFOListSpecifier */
  16. /* FloatingPoint */
  17. /* RandomNumbers */
  18. /* Frequency */
  19. /* Multisampler */
  20. /* 64BitMath */
  21. /* SampleConsts */
  22.  
  23. #include "FastFixedPoint.h"
  24.  
  25. struct LFOGenRec;
  26. typedef struct LFOGenRec LFOGenRec;
  27.  
  28. /* forwards */
  29. struct LFOListSpecRec;
  30.  
  31. typedef enum
  32.     {
  33.         eLFOArithAdditive EXECUTE(= -12431),
  34.         eLFOArithGeometric,
  35.         eLFOArithDefault
  36.     } LFOArithSelect;
  37.  
  38. /* flush cached LFO generator records */
  39. void                                FlushLFOGeneratorRecords(void);
  40.  
  41. /* create a new LFO generator based on a list of specifications */
  42. /* it returns the largest pre-origin time for all of the envelopes it contains */
  43. /* AmplitudeScaling and FrequencyScaling are provided primarily for frequency */
  44. /* LFO control; other LFOs are controlled through the accent parameters, and */
  45. /* should supply 1 (no scaling) for these parameters. */
  46. LFOGenRec*                    NewLFOGenerator(struct LFOListSpecRec* LFOListSpec,
  47.                                             long* MaxPreOriginTime, float Accent1, float Accent2,
  48.                                             float Accent3, float Accent4, float FrequencyHertz,
  49.                                             float HurryUp, float TicksPerSecond, float AmplitudeScaling,
  50.                                             float FrequencyScaling, LFOArithSelect ModulationMode,
  51.                                             float FreqForMultisampling);
  52.  
  53. /* fix up the origin time so that envelopes start at the proper times */
  54. void                                LFOGeneratorFixEnvelopeOrigins(LFOGenRec* LFOGen,
  55.                                             long ActualPreOriginTime);
  56.  
  57. /* this function computes one LFO cycle and returns the value from the LFO generator. */
  58. /* it should be called on the envelope clock. */
  59. FastFixedType                LFOGenUpdateCycle(LFOGenRec* LFOGen, FastFixedType OriginalValue);
  60.  
  61. /* pass the key-up impulse on to the envelopes contained inside */
  62. void                                LFOGeneratorKeyUpSustain1(LFOGenRec* LFOGen);
  63. void                                LFOGeneratorKeyUpSustain2(LFOGenRec* LFOGen);
  64. void                                LFOGeneratorKeyUpSustain3(LFOGenRec* LFOGen);
  65.  
  66. /* retrigger envelopes from the origin point */
  67. void                                LFOGeneratorRetriggerFromOrigin(LFOGenRec* LFOGen, float Accent1,
  68.                                             float Accent2, float Accent3, float Accent4, float FrequencyHertz,
  69.                                             float HurryUp, float TicksPerSecond, float AmplitudeScaling,
  70.                                             float FrequencyScaling, MyBoolean ActuallyRetrigger);
  71.  
  72. /* dispose the LFO generator */
  73. void                                DisposeLFOGenerator(LFOGenRec* LFOGen);
  74.  
  75. #endif
  76.